package archforce.atp.x.ui.impl.right;

import java.io.Serializable;

/**
 * @author wx
 * @version 1.0
 * @date 2022/4/11 10:12
 */
public class IPPortMappingModel implements Serializable {
    private String local;
    private Integer lPort;
    private String remote;
    private Integer rPort;

    private static final String DEFAULT_IP = "127.0.0.1";
    private static final String DEFAULT_BLANK_IP = "";
    private static final Integer DEFAULT_PORT = 22;
    private static final Integer DEFAULT_BLANK_PORT = null;

    public IPPortMappingModel(boolean blank) {
        if(blank){
            this.local = DEFAULT_BLANK_IP;
            this.lPort = DEFAULT_BLANK_PORT;
            this.remote = DEFAULT_BLANK_IP;
            this.rPort = DEFAULT_BLANK_PORT;
        }else{
            this.local = DEFAULT_IP;
            this.lPort = DEFAULT_PORT;
            this.remote = DEFAULT_BLANK_IP;
            this.rPort = DEFAULT_BLANK_PORT;
        }
    }

    public IPPortMappingModel(String local, String remote) {
        this.local = local;
        this.remote = remote;
        this.lPort = DEFAULT_PORT;
        this.rPort = DEFAULT_PORT;
    }

    public IPPortMappingModel(String local, Integer lPort, String remote, Integer rPort) {
        this.local = local;
        this.lPort = lPort;
        this.remote = remote;
        this.rPort = rPort;
    }

    public String getLocal() {
        return local;
    }

    public void setLocal(String local) {
        this.local = local;
    }

    public Integer getlPort() {
        return lPort;
    }

    public void setlPort(Integer lPort) {
        this.lPort = lPort;
    }

    public String getRemote() {
        return remote;
    }

    public void setRemote(String remote) {
        this.remote = remote;
    }

    public Integer getrPort() {
        return rPort;
    }

    public void setrPort(Integer rPort) {
        this.rPort = rPort;
    }
}
